/**************************************


Survey Quality: IAT and Responses


**************************************/

clear all
set more off
set segmentsize 3g
set scheme plotplainblind

* Load Baseline Data
use "$Data/Final/Baseline_Cleaned.dta", clear 


* Correlating IAT responses with survey response about willingess
* to take orders from non-coreligonists 

keep orders_relb comm_relb IAT_score religion

destring IAT_score, replace
label var orders_relb "Willingness to take orders from non-coreligonists"
label var IAT_score "IAT Score"



** Taking orders **

* Hindus
binscatter orders_relb IAT_score if religion == 1, nquantiles(10) ///
 title("Hindus", size(small)) ytitle("Comfortable taking orders from Muslims", size(small)) ylabel(.65(.05).9)
graph save $Output/Figures/iat_ohindus.gph, replace

* Muslims
binscatter orders_relb IAT_score if religion == 2, nquantiles(10) ///
 title("Muslims", size(small)) ytitle("Comfortable taking orders from Hindus", size(small)) ylabel(.6(.1).9)
graph save $Output/Figures/iat_omuslims.gph, replace


** Communicating **

* Hindus
binscatter comm_relb IAT_score if religion == 1, nquantiles(10) ///
 title("Hindus", size(small)) ytitle("Comfortable communicating with Muslims", size(small)) ylabel(.4(.05).6)
graph save $Output/Figures/iat_chindus.gph, replace

* Muslims
binscatter comm_relb IAT_score if religion == 2, nquantiles(10) ///
title("Muslims", size(small)) ytitle("Comfortable communicating with Hindus", size(small)) ///
ylabel(.5(.1).9)
graph save $Output/Figures/iat_cmuslims.gph, replace



gr combine  $Output/Figures/iat_ohindus.gph $Output/Figures/iat_omuslims.gph  $Output/Figures/iat_chindus.gph $Output/Figures/iat_cmuslims.gph
graph export $Output/Figures/IAT_Surveyresponses.pdf, replace

* Erase individual graphs from output folder
erase $Output/Figures/iat_ohindus.gph 
erase $Output/Figures/iat_omuslims.gph  
erase $Output/Figures/iat_chindus.gph 
erase  $Output/Figures/iat_cmuslims.gph
